

module AutoBase
  module Actionable
    module ClassMethods
      def added(&block)
        define_method(:added, &block)
      end

      def deleted(&block)
        define_method(:deleted, &block)
      end
    end

    module InstanceMethods
      def initialize(session)
        @session = session
      end

      def added(session, param = {})
        AutoBase.debug "added: #{self}"
      end

      def deleted(session, param = {})
        AutoBase.debug "deleted: #{self}"
      end
    end

    def self.included(receiver)
      receiver.extend         ClassMethods
      receiver.send :include, InstanceMethods
    end
  end
end